package com.cwj.designpatterns.factorymethod;

/**
 * @author chenwujie
 * @date 2021-03-16 09:55
 */
public class FactoryMethodTest {
    public static void main(String[] args) {
        FruitFactory fruitFactory = new AppleFactory();
        Fruit fruit = fruitFactory.createFruit();
        fruit.printName();

        fruitFactory = new BananaFactory();
        Fruit fruit1 = fruitFactory.createFruit();
        fruit1.printName();
    }
}
